// <copyright file="CalendarButton.ascx.cs" company="YUIAsp.Net">
// Copyright (c) 2009 All Right Reserved
// </copyright>
// <author>raul popescu</author>
// <email>dev@yuiasp.net</email>
// <date>2009-01-30</date>
// <summary>YUIAsp.Net File</summary>

using System;

namespace YUIAspNetDemo.Button.UserControls
{
    public partial class CalendarButton : BaseUC
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Calendar.SelectedDate.HasValue)
                calBtn.Text = Calendar.SelectedDate.Value.ToShortDateString();
        }

        public override YUIAspNet.Button Button
        {
            get { return calBtn; }
        }
        

        public string OnDateChange
        {
            get { return Calendar.OnClientSelect; }
            set { Calendar.OnClientSelect = value; }
        }

        public YUIAspNet.Calendar Calendar
        {
            get { return (YUIAspNet.Calendar) calBtn.FindControl("cal"); }
        }
    }
}